package com.tarry.cxf.config;

import com.tarry.cxf.service.IStudentService;
import org.apache.cxf.Bus;
import org.apache.cxf.jaxws.EndpointImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.xml.ws.Endpoint;

@Configuration
public class CXFConfig {

    @Autowired
    private Bus bus;

    @Autowired
    private IStudentService iStudentService;

    /**
     * 站点服务
     * @return
     */
    @Bean
    public Endpoint studentServiceEndpoint(){
        EndpointImpl endpoint = new EndpointImpl(bus,iStudentService);
        endpoint.publish("/studentService");
        return endpoint;
    }

}
